package ReserveController;

import java.util.ArrayList;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import Dao.ReserveDao;

public class Reserveconfirm implements Controller {
	private ReserveDao reserveDao;

	public void setReserveDao(ReserveDao reserveDao) {
		this.reserveDao = reserveDao;
	}

	@Override
	public ModelAndView handleRequest(HttpServletRequest arg0,
			HttpServletResponse arg1) throws Exception {
		
		ArrayList<Object> list = new ArrayList<Object>(); 
		
		String arr[] = arg0.getParameterValues("room_chk");
		
		for(int i=0;i<arr.length;i++){
			list.add(i, reserveDao.getInfo(arr[i])); 
		}
		
		ModelAndView mav = new ModelAndView();
		mav.addObject("list",list);
		mav.setViewName("reserveconfirm");

		return mav;
	}

}
